package com.tongyi.lizhishop.utils;

import com.tongyi.lizhishop.beans.InfoFriendBean;

import java.text.SimpleDateFormat;

/**
 * Created by meijun on 17-12-30.
 */

public class AppStringUtils {

    public static String getStateString(String index) {
        int stateindex = Integer.parseInt(index);
        String result = "";
        switch (stateindex) {
            case 1:
                result = "正在审核";
                break;
            case 2:
                result = "通过";
                break;
            case 3:
                result = "驳回";
                break;
            case 4:
                result = "已开始";
                break;
            case 5:
                result = "已接收";
                break;
        }
        return result;
    }

    public static String getWithDrawStateString(int index) {
        String result = "";
        switch (index) {
            case 1:
                result = "申请中";
                break;
            case 2:
                result = "成功";
                break;
            case 3:
                result = "失败";
                break;
        }
        return result;
    }

    public static String getSafeTime(String formate, String time) {

        try {

            SimpleDateFormat simpleDateFormat = new SimpleDateFormat(formate);
            long date = Long.parseLong(time);
            String format = simpleDateFormat.format(date);
            return format;
        } catch (Exception e) {
            e.printStackTrace();
            return time;
        }

    }

    public static String getInfoFriendMoney(InfoFriendBean.ArrayBean arrayBean) {

        String sign = arrayBean.getSco_state() == 1 ? "+" : "-";
        return sign + arrayBean.getSco_num();
    }


    public static String getBillParams(int index) {
        String result = "";
        switch (index) {
            case 0:
                result = "1";
                break;
            case 1:
                result = "2";
                break;
            case 2:
                result = "0";
                break;
        }
        return result;
    }
}
